﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="PPAP.Web.Master.Users" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title></title>
   <script language="javascript">
       function add() {
           url = "UsersEdit.aspx";
           PopUpWindow(url, 230, 160, 780, 420);
       }
       function edit(id) {
           url = "UsersEdit.aspx?DID=" + id;
           PopUpWindow(url, 230, 160, 780, 420);
       }
       function del(id) {
           if (confirm('Please confirm to delete the user.')) {
               url = "Users.aspx?deid=" + id;
               window.location.href = url;
           }
       }
		</script>
</head>
<body  style="font-family: Arial, Helvetica, sans-serif;" >
    <form id="form1" runat="server">
    <div>
    <table width="100%" class="table" style="display:none;">
    <tr><td style="width:25%">
        Family name
        </td><td style="width:25%">
            <asp:TextBox ID="txtFamilyname" runat="server"></asp:TextBox><font color='red'>*</font>
        </td><td style="width:25%">
            First name
        </td><td style="width:25%">
            <asp:TextBox ID="txtFirstname" runat="server"></asp:TextBox><font color='red'>*</font>
        </td></tr>
          <tr><td>
              UserName</td><td>
                  <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox><font color='red'>*</font>
        </td><td>
        Email</td><td>
            <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
        </td></tr>
          <tr><td>
            Mobile phone
        </td><td style="width:25%">
            <asp:TextBox ID="txtMobilephone" runat="server"></asp:TextBox>
        </td><td>
        Department
        </td><td>
            <asp:DropDownList ID="ddlDepartment" runat="server">
            </asp:DropDownList>
        </td></tr>
        <tr><td>
            Position
        </td><td>
                <asp:DropDownList ID="ddlPosition" runat="server">
            </asp:DropDownList>
                </td><td>
                Execute inspection task？</td><td>
           &nbsp;<asp:RadioButton ID="rbtY" runat="server" Checked="True" GroupName="s" 
                    Text="Yes" />
&nbsp;<asp:RadioButton ID="rbtN" runat="server" GroupName="s" Text="No" />
        </td></tr>
    
    <tr><td colspan="2" align="left" class="style2">Initial password:123456</td><td colspan="2" class="style1">
        <asp:Button ID="Button1" CssClass="button" runat="server" 
            Text="Add" onclick="Button1_Click" 
            onclientclick="return confirm('Are you sure you want to save?');" /></td></tr></table>
             <table width="100%"><tr><td align="right"><input value="Add" onclick="javascript:add();" class="button" type="button" /></td></tr></table>

<asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333" 
            GridLines="None" AutoGenerateColumns="False">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:TemplateField HeaderText="No." ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
       
        <asp:TemplateField HeaderText="Family name" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("FAMILYNAME") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="First name" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Eval("FIRSTNAME") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="UserName" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Eval("username") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Position" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label4" runat="server" Text='<%# Eval("POSITION") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Department" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label5" runat="server" Text='<%# Eval("department") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
         <asp:TemplateField HeaderText="Email" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label6" runat="server" Text='<%# Eval("EMAIL") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
         <asp:TemplateField HeaderText="Mobile phone" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label7" runat="server" Text='<%# Eval("MOBILEPHONE") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Sort" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label7" runat="server" Text='<%# Eval("sort") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:HyperLinkField DataNavigateUrlFields="ID"  Visible="false" HeaderText="Edit" ItemStyle-HorizontalAlign="Center"
            DataNavigateUrlFormatString="Users.aspx?DID={0}" Text="Edit" />
             <asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton2" Visible="false" PostBackUrl=<%#"javascript:edit("+Eval("ID")+");" %> runat="server">Edit</asp:LinkButton>
                <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+")" %>" />
            </ItemTemplate>
        </asp:TemplateField>
            <asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" Visible="false"  runat="server" onclientclick="return confirm('Please confirm to delete the file.')" 
                        PostBackUrl=<%# "Users.aspx?deid="+Eval("ID") %>
                        >Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("ID")+")" %>" />
                </ItemTemplate>
        </asp:TemplateField>
    </Columns>
     <EditRowStyle BackColor="#2E8AC5" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
     <webdiyer:AspNetPager ID="AspNetPager2"  runat="server" Width="100%" CssClass="paginator"
                                ShowPageIndexBox="Always" 
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
                                HorizontalAlign="Center" PageSize="20" EnableTheming="true" 
                        AlwaysShow="True" FirstPageText="|&lt;"
                                LastPageText="&gt;|" NextPageText="&gt;" 
                        PrevPageText="&lt;" SubmitButtonText="Go"
                                TextAfterPageIndexBox="page" 
                        InvalidPageIndexErrorMessage="Page index is not effective numerical！" 
                        onpagechanged="AspNetPager2_PageChanged" 
                        PageIndexOutOfRangeErrorMessage="Page index beyond range" 
            BackColor="#E7E8E8" >
                            </webdiyer:AspNetPager>
    </div>
    
    
    </form>
</body>
</html>
